package cn.madis.ymcc;

import cn.madis.ymcc.doc.CourseDoc;
import cn.madis.ymcc.fallback.SearchFeignClientFallbackFactory;
import cn.madis.ymcc.result.JSONResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@FeignClient(value = "service-search",fallbackFactory = SearchFeignClientFallbackFactory.class)
public interface SearchFeignClient {
    @RequestMapping(value="/search/save",method= RequestMethod.POST)
    JSONResult save(@RequestBody CourseDoc courseDoc);

    /**
     * 课程信息保存到es中
     */
    @RequestMapping(value="/search/remove/{courseId}",method= RequestMethod.POST)
    JSONResult remove(@PathVariable Long courseId);
}
